package com.koko.feign;

import com.koko.config.FeignClientConfig;
import com.koko.result.Result;
import com.koko.user.vo.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "user-service", url = "http://localhost:8081", configuration = FeignClientConfig.class)
public interface UserFeignService {
    /**
     * 判断用户是否有游戏
     * @param userId
     * @param gameId
     * @return
     */
    @GetMapping("/user/game/ishave")
    String isUserHaveGame(@RequestParam Long userId, @RequestParam Long gameId);

    /**
     * 获取用户信息
     * @param id
     * @return
     */
    @GetMapping("/user/{id}")
    Result<UserVO> getUserByUserId(@PathVariable Long id);

    /**
     * 让用户付款
     * @param toPay
     * @return
     */
    @PostMapping("/user/pay")
    Result<String> pay(@RequestBody String toPay);
}
